package com.sparrow.manage.comment;

import com.sparrow.manage.common.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl extends BaseServiceImpl<Comment, String> implements CommentService {

    @Autowired
    private CommentDao commentDao;

    @Override
    protected JpaRepository<Comment, String> getDao() {
        return this.commentDao;
    }

    @Override
    public List<Comment> queryByType(Comment.CommentType type, int count) {
        return commentDao.queryByType(type.getCode(), count);
    }

    @Override
    public void deleteHistory() {
        commentDao.deleteHistory();
    }
}
